<template>
  <div class="search-wrap" ref="search">
    <a-form-model layout="vertical" ref="searchFormModel">
      <a-row :gutter="15">
        <a-col v-bind="gridCol" v-for="(item,index) in formConfig" :key="index" :style="{display:(index+1) > hiddenGrid && expand?'none':'block'}">
          <a-form-model-item :label="item.label" :prop="item.name">
            <slot :name="item.name" v-bind:data="searchForm" />
          </a-form-model-item>
        </a-col>
      </a-row>
    </a-form-model>
    <a-row>
      <a-col :span="24" :style="{ textAlign: 'right' }">
        <a-space>
          <a-button @click="searchReset">
            重置
          </a-button>
          <a-button type="primary" @click="searchHandler">
            搜索
          </a-button>
          <a :style="{ marginLeft: '8px', fontSize: '12px' }" @click="toggle">
            {{ expand ?"展开"  : "折叠" }}
            <a-icon :type="expand ? 'down':  'up' " />
          </a>
        </a-space>
      </a-col>
    </a-row>
  </div>
</template>
<script>
import searchWrapMixin from '@/components/mixins/searchWrap'
export default {
  name: "searchWrap",
  mixins:[searchWrapMixin]

};
</script>
<style scoped>
.search-wrap {
  width: 100%;
  padding: 10px;
  background: #fff;
  margin-bottom: 10px;
}
</style>
